<meta title="修改抢购" width="1000px" args="flashSaleItemedit"/>
<div class="p">
    <form s="valid,form,nda,datac"
          id="form" class="form-horizontal p"
          method="put"
          s-data="flashSaleItemedit"
          action="api/flashSaleItem/{flashSaleItemedit.id}">
        <table class="table table-bordered table-striped">
            <tr>
                <td style="width: 100px;" class="text-right">日期</td>
                <td  style="width: 200px;">
                    <input autocomplete="off" type="text" s="datetimepicker" s-valid-error="require()"
                           class="form-control input-sm" placeholder="选择日期" name="date" disabled />
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">场次</td>
                <td>
                    <select class="form-control input-sm" s="select"
                            s-select="{value: 'time'}"
                            s-build="S.get('/api/flashSaleItemSetting/seasonList')"
                            name="season" disabled>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">图片</td>
                <td s="tpl">
                    <img src="{%=this.item.picUrl%}" style="max-width: 50px; max-height: 50px;"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">商品</td>
                <td s="tpl" style="width: 400px;">
                    <a href="{%=this.item.sourceItemUrl%}"
                       target="_blank" external style="max-width: 250px;">{%=this.item.title%}</a>
                    <input autocomplete="off" type="text" class="form-control"
                           placeholder="标语" name="slogan"/>
                    <input type="hidden" class="form-control" name="itemId"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">标签</td>
                <td>
                    <input autocomplete="off" s-valid-error="require()" type="text" step="1"
                           class="form-control input-sm" placeholder="标签" name="label" style="width: 100px;"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">价格</td>
                <td s="tpl">
                    <span name="price">{%=this.item.price%}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">券值</td>
                <td s="tpl">
                    <span name="couponValue">{%=this.item.couponValue%}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">佣金</td>
                <td s="tpl">
                    {%if(this.item.highCommission){%}
                    <label class="label label-warning">{%=this.item.commissionRate%}%</label>
                    {%}else{%}
                    <label class="label label-info">{%=this.item.commissionRate%}%</label>
                    {%}%}
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">返金额</td>
                <td>
                    <input autocomplete="off" s-valid-error="require(),number()" type="number" step="1"
                           class="form-control input-sm" placeholder="返钱" name="returnFee"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">免单数</td>
                <td>
                    <input autocomplete="off" s-valid-error="require(),number()" type="number" step="1"
                           class="form-control input-sm" placeholder="免单数" name="totalNum"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">级别限制</td>
                <td>
                    <select class="form-control input-sm" s="select"
                            name="userLevel"
                            s-build="S.get('/api/enum/valuesMap/core.enums.UserLevel')">
                    </select>
                </td>
            </tr>
            <tr>
                <td style="width: 100px;" class="text-right">平台</td>
                <td s="tpl">
                    <input value="{%=this.status%}" type="hidden" name="status">
                    <span name="ecomPlatTitle">{%=this.item.ecomPlatTitle%}</span>
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">
    S.meta.btns = [
        {
            name: "保存",
            style: "btn btn-primary",
            click: function () {
                return $form.submit().done(function () {
                    S.close(true);
                })
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function () {
                S.close();
            }
        }
    ]

</script>